﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" ValidateRequest="false"  Inherits="Installation_Default" %>
<%@ Import Namespace="PigeonCms" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphMain" Runat="Server">

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="Upd1">
    <ProgressTemplate>
        <div class="loading"><%=PigeonCms.Utility.GetLabel("LblLoading", "loading") %></div>
    </ProgressTemplate>
</asp:UpdateProgress>
    
<asp:UpdatePanel ID="Upd1" runat="server">
<Triggers>
    <%--<asp:PostBackTrigger ControlID="FileUpload1" />--%>
</Triggers>
<ContentTemplate>
    
    <h1>Installation</h1>

    <div class="adminToolbar">
        <asp:Button ID="BtnPrevious" runat="server" Text="Previous" CssClass="button" OnClick="BtnPrevious_Click" />
        <asp:Button ID="BtnNext" runat="server" Text="Next" CssClass="button" OnClick="BtnNext_Click" />
    </div>

    <fieldset class="adminForm">
        <asp:Label ID="LblErr" runat="server" Text="" CssClass="error"></asp:Label>
        <asp:Label ID="LblOk" runat="server" Text="" CssClass="success"></asp:Label>
    </fieldset>

    <div class="col width-20">
    <h2>Steps</h2>
    <ul class="bar">
        <%=StepsList %>
    </ul>
    </div>
    
    <div class="col width-80">
    
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" OnActiveViewChanged="MultiView1_ActiveViewChanged">
   
        <asp:View ID="ViewSystem" runat="server">
            <h2>Step: System check</h2>
            <fieldset class="adminForm">
                <legend>Server variables</legend>
                <table cellspacing="0" class="adminTable">
                <tr>
                    <td><%=ServerVariables %></td>
                </tr>
                </table>
            </fieldset>
            <fieldset class="adminForm">
                <legend>Files permissions</legend>
                <%=FilesPermissionsList %>
            </fieldset>            
        </asp:View>
   
        <asp:View ID="ViewDatabase" runat="server">
            <h2>Step: Database settings</h2>
            <fieldset class="adminForm">
                <legend>Connection string</legend>
                <table cellspacing="0" class="adminTable">
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "sql server version", RadioSqlversion)%></td>
                    <td>
                        <asp:RadioButtonList ID="RadioSqlversion" runat="server" AutoPostBack="true"
                        OnSelectedIndexChanged="RadioSqlversion_SelectedIndexChanged">
                            <asp:ListItem Value="standard" Selected="True">standard</asp:ListItem>
                            <asp:ListItem Value="express">express</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td>choose between a standard or express sqlserver version (SQLServer 2005 and 2008 are supported)</td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "name", TxtConnectionName) %></td>
                    <td>
                        <asp:TextBox ID="TxtConnectionName" Text="default" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>the name of connection string. If you are an advanced user you can manage more than one database with the same installation</td>
                </tr>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "host name", TxtHostName) %></td>
                    <td>
                        <asp:TextBox ID="TxtHostName" Text="(local)" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>host name or ip address (".\SQLEXPRESS" for SqlServer Express version)</td>
                </tr>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "database name", TxtDbName)%></td>
                    <td>
                        <asp:TextBox ID="TxtDbName" Text="pigeondb" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>the name of the existing database to use</td>
                </tr>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "user id", TxtUserId)%></td>
                    <td>
                        <asp:TextBox ID="TxtUserId" Text="" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>database user</td>
                </tr>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "password", TxtPassword)%></td>
                    <td>
                        <asp:TextBox ID="TxtPassword" Text="" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>database password</td>
                </tr>
                </table>
            </fieldset>
                
            <fieldset class="adminForm">
            <legend>Other settings</legend>
                <table cellspacing="0" class="adminTable">                
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "tables prefix", TxtTablesPrefix)%></td>
                    <td>
                        <asp:TextBox ID="TxtTablesPrefix" Text="pgn_" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>change the default value only if you want to use this database to manage more than one PigeonCms instance.</td>
                </tr> 
                <%--<tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "create database", ChkCreateDb) %></td>
                    <td>
                        <asp:CheckBox ID="ChkCreateDb" runat="server" Enabled="true" Checked="false" />
                    </td>
                    <td>check to create a new database</td>
                </tr>--%>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "backup old tables", ChkBackupTables)%></td>
                    <td>
                        <asp:CheckBox ID="ChkBackupTables" runat="server" Enabled="false" Checked="false" />
                    </td>
                    <td>check to create backup of the old existing tables</td>
                </tr>
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "install example data", ChkExampleData)%></td>
                    <td>
                        <asp:CheckBox ID="ChkExampleData" runat="server" Enabled="false" Checked="true" />
                    </td>
                    <td>don't uncheck if you are not an advanced user</td>
                </tr>
                
                </table>
            </fieldset>
        </asp:View>
        
        <asp:View ID="ViewSite" runat="server">
            <h2>Step: Site info</h2>
            <fieldset class="adminForm">
                <legend>Site info</legend>
                <table cellspacing="0" class="adminTable">
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "site title", TxtSiteTitle) %></td>
                    <td>
                        <asp:TextBox ID="TxtSiteTitle" Text="" runat="server" CssClass="adminText"></asp:TextBox>
                    </td>
                    <td>example: Gino's website</td>
                </tr>
                </table>
                </fieldset>
                
                <fieldset class="adminForm">
                <legend>Admin info</legend>
                <table cellspacing="0" class="adminTable">
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "admin password", TxtAdminPassword)%></td>
                    <td>
                        <asp:TextBox ID="TxtAdminPassword" Text="" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>administrator's password</td>
                </tr>                
                <tr>
                    <td class="key"><%=PigeonCms.Utility.GetLabel("", "e-mail", TxtEmail) %></td>
                    <td>
                        <asp:TextBox ID="TxtEmail" Text="" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
                    </td>
                    <td>administrator's email</td>
                </tr>
                </table>
            </fieldset>
        </asp:View>
        
        <asp:View ID="ViewSummary" runat="server">
            <h2>Step: Settings summary</h2>
            <fieldset class="adminForm">
                <legend>Settings summary</legend>
                <table cellspacing="0" class="adminTable">
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "connection string") %></td>
                    <td>
                        <asp:Literal ID="LitConnString" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "tables prefix") %></td>
                    <td>
                        <asp:Literal ID="LitTablesPrefix" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "backup old tables") %></td>
                    <td>
                        <asp:Literal ID="LitBackupTables" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "install example data") %></td>
                    <td>
                        <asp:Literal ID="LitInstallExampleData" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "site title") %></td>
                    <td>
                        <asp:Literal ID="LitSiteTitle" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "site url") %></td>
                    <td>
                        <asp:Literal ID="LitSiteUrl" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "admin user") %></td>
                    <td>admin</td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "admin password") %></td>
                    <td>
                        <asp:Literal ID="LitAdminPassword" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="key"><%=Utility.GetLabel("", "email") %></td>
                    <td>
                        <asp:Literal ID="LitEmail" runat="server"></asp:Literal>
                    </td>
                </tr>
                </table>
                </fieldset>
        </asp:View>
        
        <asp:View ID="ViewFinish" runat="server">
            <h2>Installation completed</h2>
            <fieldset class="adminForm">
            <p>
            You have sucessfully installed PigeonCms.<br />
            Please visit <a href="http://www.pigeoncms.com">pigeoncms.com</a> for further
            information.</p>
            <p>
            Visit your website <a href='<%=Utility.GetAbsoluteUrl() %>'>homepage</a><br />
            <a href='<%=Utility.GetAbsoluteUrl() + "pages/admin.aspx" %>'>Administer</a> your website<br />
            </p>
            </fieldset>
        </asp:View>        
    </asp:MultiView>
    </div>

</ContentTemplate>
</asp:UpdatePanel>     


</asp:Content>